#include <iostream>

using namespace std;

class Line
{
public:
    Line(int x1, int y1, int x2, int y2);
    ~Line();
    void print()const;

private:        
    class Point;
    Point *_px; 
    Point *_py; 
};

class Line::Point
{
public:
    Point(int x, int y);
    void print()const;

private:
    int _x;
    int _y;
};

Line::Point::Point(int x, int y): _x(x), _y(y){}

void Line::Point::print()const
{
    cout << this->_x << "," << this->_y << endl;
}

Line::Line(int x1, int y1, int x2, int y2): _px(new Line::Point(x1, y1)), _py(new Line::Point(x2, y2))
{}

Line::~Line()
{
    delete _px;
    delete _py;

    _px = nullptr;
    _py = nullptr;
}

void Line::print()const
{
    this->_px->print();
    this->_py->print();

    cout << "calculate by yourself" << endl;
}

void test()
{
    Line line1(0, 0, 3, 4);
    line1.print();
}

int main()
{
    test();
    return 0;
}

